import React from 'react';
import { Layout } from 'tdesign-react';
import PostForm from '../components/PostForm';

const { Content } = Layout;

const CreatePostPage = ({ post, onSubmit, onCancel }) => {
  return (
    <Content style={{ 
      padding: '24px',
      maxWidth: '1200px',
      margin: '0 auto',
      width: '100%'
    }}>
      <h2 style={{
        fontSize: window.innerWidth < 768 ? '1.5rem' : '2rem',
        fontWeight: '700',
        marginBottom: '24px',
        color: '#1e293b'
      }}>
        {post ? '编辑文章' : '新建文章'}
      </h2>
      <PostForm post={post} onSubmit={onSubmit} onCancel={onCancel} />
    </Content>
  );
};

export default CreatePostPage;